﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Frame;

namespace Qvaliz.CAD.Relatorios
{
    public partial class Dados_alunos : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string[] varURL = Request.QueryString.ToString().Split(new char[]{'='});
                string nameColumn = string.Empty;
                foreach (string param in varURL)
                {
                    try
                    {
                        nameColumn = param.Replace("S&", "");
                        if (!string.IsNullOrEmpty(nameColumn) && nameColumn != "S")
                            rdg_DadosAlunos.Columns.FindByUniqueName(nameColumn).Visible = true;
                    }
                    catch {}
                }
            }
        }

        protected void rapGrid_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
        {

        }

        protected void imgbRetornar_Click(object sender, ImageClickEventArgs e)
        {
            Response.Redirect("~/Relatorios/Relatorio.aspx?RELATORIO=dadosAlunos");
        }

        protected void ods_DadosAlunos_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            e.InputParameters["TURMA_ID"] = Request.QueryString["TURMA_ID_SELECTED"];
            e.InputParameters["ALU_STEXCLUIDO"] = "0";
            e.InputParameters["ORDER_BY_CLAUSE"] = "ALUNO.NOME_ALUNO";
        }

        
    }
}